<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:jsf="http://xmlns.jcp.org/jsf"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                xmlns:p="http://primefaces.org/ui">

    <div>
        <p:panel header="USUARIOS Y ACCESOS GLOBALES" style="border:none;">
            <div align="center">
                <h:form>
                    <p:dataTable value="#{companyBean.listCompany}"
                                 var="comp" paginator="true" rows="15" filterDelay="600"
                                 currentPageReportTemplate="{startRecord}-{endRecord} :TOTAL: {totalRecords}"
                                 paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
                                 emptyMessage="No existen Empresas." >
                        <p:column width="5">
                            <p:menuButton styleClass="menubutton-for-table"> 
                                <p:menuitem value="Editar" icon="ui-icon-pencil" 
                                            update=":panelPrincipalId">  
                                    <f:setPropertyActionListener 
                                        target="#{companyBean.company}"
                                        value="#{comp}" />
                                    <f:setPropertyActionListener 
                                        value="./pages/content/user/create_company.xhtml" 
                                        target="#{navigationBean.navigationContent}"/>
                                </p:menuitem>
                                <p:menuitem value="Historial" icon="ui-icon-note" 
                                            update=":panelPrincipalId" 
                                            action="#{companyBean.initValuesForHistory()}">  
                                    <f:setPropertyActionListener 
                                        target="#{companyBean.company}"
                                        value="#{comp}" />
                                    <f:setPropertyActionListener 
                                        value="./pages/content/user/company_history.xhtml" 
                                        target="#{navigationBean.navigationContent}"/>
                                </p:menuitem>
                            </p:menuButton>
                        </p:column>
                        <p:column headerText="Ruc" width="5">
                            #{comp.ruc}
                        </p:column>
                        <p:column headerText="Nombre Emp.">
                            #{comp.name}
                        </p:column>
                        <p:column headerText="Contacto"> 
                            #{comp.contact}
                        </p:column>
                        <p:column headerText="Busquedas Hab." width="5"> 
                            #{comp.numberSearch}
                        </p:column>
                        <p:column headerText="Teléfono" width="5"> 
                            #{comp.phone}
                        </p:column>
                    </p:dataTable>
                </h:form>
            </div>
        </p:panel>
    </div>
</ui:composition>

